using System;
using System.Net.Sockets;

namespace Stunt.Nutss.Stunt
{

	/// <summary>The listener interface for receiving socket events.</summary>
	public interface ISTUNTEventListener
	{

		/// <summary> Called when an error occus on the socket</summary>
		/// <param name="e">the execption throwns</param>
		void ErrorHandler(Exception e);

		/// <summary>Called when a socket is accepted by a server</summary>
		/// <param name="s">Accepted socket</param>
		/// <param name="u">Uri of the remotee endpoint</param>
		void AcceptHandler(Socket s, NutssUri u);

		/// <summary>Called when a socket is accepted by a server</summary>
		/// <param name="s">Accepted socket</param>
		/// <param name="u">Uri of the remotee endpoint</param>
		void AcceptTCPHandler(Socket s, NutssUri u);

		/// <summary>Called when a socket is accepted by a server</summary>
		/// <param name="s">Accepted socket</param>
		/// <param name="u">Uri of the remotee endpoint</param>
		void AcceptUDPHandler(Socket s, NutssUri u);

		/// <summary>Called when a socket successfully connects.</summary>
		/// <param name="s">the connected socket</param>
		void ConnectHandler(Socket s);

		/// <summary>Called when a socket successfully connects.</summary>
		/// <param name="s">the connected socket</param>
		void ConnectTCPHandler(Socket s);

		/// <summary>Called when a socket successfully connects.</summary>
		/// <param name="s">the connected socket</param>
		void ConnectUDPHandler(Socket s);
	}
}